<template>
	<view class="content">
		<img class="logo" src="/static/logo.png" />
		<view>
			<uni-calendar ref="calendar" :insert="false" @confirm="confirm" />
			<button @click="open">打开日历szd</button>
		</view>
	</view>
</template>

<script setup lang="ts">
// 声明 Ref 类型
interface CalendarRef {
	open: () => void
}
const calendar: Ref<CalendarRef | null> = ref(null) // 使用 Ref 类型声明
function open() {
	calendar.value?.open()
}
function confirm(e: object) {
	console.log(e)
}
</script>

<style>
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.logo {
	height: 100px;
	width: 100px;
	margin-top: 100px;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 10px;
}
</style>
